package cn.iocoder.yudao.module.scrm.dal.mysql.marketing;


import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.scrm.controller.admin.marketing.vo.transmit.MarketingTransmitPageReqVO;
import cn.iocoder.yudao.module.scrm.dal.dataobject.marketing.MarketingTransmitDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 营销转发 Mapper
 *
 * @author admin
 */
@Mapper
public interface MarketingTransmitMapper extends BaseMapperX<MarketingTransmitDO> {

    default PageResult<MarketingTransmitDO> selectPage(MarketingTransmitPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MarketingTransmitDO>()
                .eqIfPresent(MarketingTransmitDO::getContentId, reqVO.getContentId())
                .eqIfPresent(MarketingTransmitDO::getUserId, reqVO.getUserId())
                .eqIfPresent(MarketingTransmitDO::getSource, reqVO.getSource())
                .eqIfPresent(MarketingTransmitDO::getSourceType, reqVO.getSourceType())
                .likeIfPresent(MarketingTransmitDO::getName, reqVO.getName())
                .eqIfPresent(MarketingTransmitDO::getDept, reqVO.getDept())
                .eqIfPresent(MarketingTransmitDO::getShareCount, reqVO.getShareCount())
                .eqIfPresent(MarketingTransmitDO::getBrowseCount, reqVO.getBrowseCount())
                .eqIfPresent(MarketingTransmitDO::getGainCustomerCount, reqVO.getGainCustomerCount())
                .eqIfPresent(MarketingTransmitDO::getLinkId, reqVO.getLinkId())
                .betweenIfPresent(MarketingTransmitDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MarketingTransmitDO::getId));
    }

}